package async;

import java.util.Random;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ThenRunDemo {
    public static void main(String[] args) {
        ExecutorService executorService = Executors.newFixedThreadPool(100);
        CompletableFuture.supplyAsync(() -> {
            int i = new Random().nextInt(100);
            return i;
        }).thenRun(() -> System.out.println("run方法执行"));
        executorService.shutdown();
    }
}
